﻿using System;
using System.Data;
using System.Text;

namespace Anchor.Miscellaneous.Habbo
{
    public class HabboManager
    {
        #region Fields
        private int mID;
        private string mUsername;
        private int mRole;
        private string mFigure;
        private string mGender;
        private string mMotto;
        private bool mIsOnline;
        private int mCredits;
        #endregion

        public int ID
        {
            get { return mID; }
            set { mID = value; }
        }
        public string Username
        {
            get { return mUsername; }
            set { mUsername = value; }
        }
        public int Role
        {
            get { return mRole; }
            set { mRole = value; }
        }
        public string Motto
        {
            get { return mMotto; }
            set { mMotto = value; }
        }
        public string Figure
        {
            get { return mFigure; }
            set { mFigure = value; }
        }
        public string Gender
        {
            get { return mGender; }
            set { mGender = value; }
        }
        public bool IsOnline
        {
            get { return mIsOnline; }
            set
            {
                mIsOnline = value;
            }
        }
        public int Credits
        {
            get { return mCredits; }
            set
            {
                mCredits = value;
            }
        }

        public HabboManager Init(DataRow row)
        {
            HabboManager Habbo = new HabboManager();

            Habbo.ID = (int)row["id"];
            Habbo.Username = (string)row["username"];
            Habbo.Figure = (string)row["figure"];
            Habbo.Gender = (string)row["gender"];
            Habbo.Motto = (string)row["motto"];
            Habbo.Role = (int)row["role"];
            Habbo.Credits = (int)row["coins"];
            if ((int)row["SockId"] > 0)
                Habbo.IsOnline = true;
            else
                Habbo.IsOnline = false;


            return Habbo;
        }
    }
}
